<template>
  <!-- 详情 -->
  <el-dialog
    :visible.sync="dialogVisible"
    width="50%"
    append-to-body
    :close-on-click-modal="false"
    :before-close="closedialog"
  >
    <el-descriptions
      class="margin-top"
      title="舱单申报头详情 "
      :column="2"
      border
    >
      <el-descriptions-item>
        <template slot="label"> 统一申报编号 </template>
        {{ form.unifiedCode }}
      </el-descriptions-item>
      <el-descriptions-item>
        <template slot="label"> 运输批次号 </template>
        {{ form.manifestId }}
      </el-descriptions-item>
      <el-descriptions-item>
        <template slot="label"> 进出口类型 </template>
				<dict-tag :options="dict.type.mft_ieport_type" :value="form.iEFlag"></dict-tag>
      </el-descriptions-item>
      <el-descriptions-item>
        <template slot="label"> 舱单业务编号 </template>
        {{ form.customsStateCode }}-
        <dict-value
          :list="dict.type.mft_biz_mode"
          :dictCode="form.customsStateCode"
        ></dict-value>
      </el-descriptions-item>
      <el-descriptions-item>
        <template slot="label"> 运输工具代理企业代码 </template>
        {{ form.agentEntCode }}
      </el-descriptions-item>
      <el-descriptions-item>
        <template slot="label"> 进出境口岸海关代码 </template>
				{{ form.customsCode }}-
          <dict-value
            :list="customsList"
            value="customsCode"
            label="customsName"
            :dictCode="form.customsCode"
          ></dict-value>
      </el-descriptions-item>
      <el-descriptions-item>
        <template slot="label"> 装载时间不能为空 </template>
        {{ form.loadTime }}
      </el-descriptions-item>
      <el-descriptions-item>
        <template slot="label"> 卸货点代码 </template>
        {{ form.unloadCode }}
      </el-descriptions-item>
      <el-descriptions-item>
        <template slot="label"> 装货地代码 </template>
        {{ form.loadCode }}
      </el-descriptions-item>
      <el-descriptions-item>
        <template slot="label"> 传输企业备案关区 </template>
        {{ form.customMasterCode }}
      </el-descriptions-item>
      <el-descriptions-item>
        <template slot="label"> 到达卸货地时间 </template>
        {{ form.arrivalDate }}
      </el-descriptions-item>
      <el-descriptions-item>
        <template slot="label"> 舱单申报状态 </template>
				<dict-tag :options="dict.type.mft_bd_decl_status" :value="form.mftDeclStatus"></dict-tag>
      </el-descriptions-item>
      <el-descriptions-item>
        <template slot="label"> 确报申报状态 </template>
				<dict-tag :options="dict.type.mft_bd_decl_status" :value="form.bdDeclStatus"></dict-tag>
      </el-descriptions-item>
      <el-descriptions-item>
        <template slot="label"> 舱单传输人代码 </template>
        {{ form.msgRepCode }}
      </el-descriptions-item>
      <el-descriptions-item>
        <template slot="label"> 舱单传输人名称 </template>
        {{ form.msgRepName }}
      </el-descriptions-item>
      <el-descriptions-item>
        <template slot="label"> 起始监管场所 </template>
				<dict-value
            :list="fieldOptions"
            :dictCode="form.startFieldCode"
          ></dict-value>
      </el-descriptions-item>
      <el-descriptions-item>
        <template slot="label"> 承运人代码 </template>
        {{ form.carrierCode }}
      </el-descriptions-item>
      <el-descriptions-item>
        <template slot="label"> 确报类型 </template>
        {{ form.bindingtype }}
      </el-descriptions-item>
      <el-descriptions-item>
        <template slot="label"> 创建人 </template>
        {{ form.createBy }}
      </el-descriptions-item>
      <el-descriptions-item>
        <template slot="label"> 创建时间 </template>
        {{ form.createTime }}
      </el-descriptions-item>
      <el-descriptions-item>
        <template slot="label"> 修改人 </template>
        {{ form.updateTime }}
      </el-descriptions-item>
      <el-descriptions-item>
        <template slot="label"> 修改时间 </template>
        {{ form.updateBy }}
      </el-descriptions-item>
      <el-descriptions-item>
        <template slot="label"> 备注 </template>
        {{ form.remark }}
      </el-descriptions-item>
    </el-descriptions>
    <div slot="footer" class="dialog-footer" style="text-align: center">
      <el-button @click="closedialog">关闭</el-button>
    </div>
  </el-dialog>
</template>

<script>
import { getMftManifestHead } from "@/api/swdecl/mftManifestHead";
export default {
  props: {
    detailId: {},
    dict: {},
    customsList: {
      type: Array,
      default: () => [],
    },
    fieldOptions: {
      type: Array,
      default: () => [],
    },
  },
  data() {
    return {
      //显示详情
      dialogVisible: false,
      form: {
        id: null,
        manifestId: null,
        iEFlag: null,
        customsStateCode: null,
        agentEntCode: null,
        customsCode: null,
        loadTime: null,
        unloadCode: null,
        loadCode: null,
        customMasterCode: null,
        arrivalDate: null,
        msgRepCode: null,
        msgRepName: null,
        startFieldCode: null,
        startFieldName: null,
        carrierCode: null,
        bindingtype: null,
        createBy: null,
        createTime: null,
        updateTime: null,
        updateBy: null,
        remark: null,
      },
    };
  },
  watch: {
    detailId: {
      immediate: true,
      handler(val) {
        if (val) {
          this.loadDetail();
        }
      },
    },
  },
  methods: {
    open() {
      this.dialogVisible = true;
    },
    closedialog() {
      this.dialogVisible = false;
    },
    // 获取详情
    loadDetail() {
      getMftManifestHead(this.detailId).then((res) => {
        if (res.code == 200) {
          this.form = res.data;
        }
      });
    },
  },
};
</script>

<style>
</style>
